package com.softline.documentsmall.dao;

import com.softline.documentsmall.entity.RandomDictionary;
import com.softline.documentsmall.entity.RandomDictionaryVO;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface RandomDictionaryMapper {

    /**
     * 根据id删除
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 随机词条新增
     * @param record
     * @return
     */
    int insert(RandomDictionary record);

    int insertSelective(RandomDictionary record);

    RandomDictionary selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(RandomDictionary record);

    int updateByPrimaryKey(RandomDictionary record);

    /**
     * 根据语种查询随机词条列表页
     * @param type
     * @return
     */
    List<RandomDictionaryVO> listByLanguage(@Param("type") String type);

    /**
     * 查询随机词条是否存在
     * @param dictionaryId
     * @return
     */
    RandomDictionary select(@Param("dictionaryId") Integer dictionaryId);
}